//
//  CollectionViewCell3.m
//  Civacrm
//
//  Created by 王桂敏 on 2017/2/23.
//  Copyright © 2017年 王桂敏. All rights reserved.
//

#import "CollectionViewCell3.h"

@implementation CollectionViewCell3

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initView];
    }
    return self;
}

- (void)initView{
    self.backgroundColor = WhiteColor;
    
    self.imageView = [UIImageView imageViewWithFrame:CGRectMake(0, h(17), w(86), w(86)) image:nil];
    self.imageView.centerX = kScreenWidth / 8;
    self.imageView.layer.masksToBounds = YES;
    self.imageView.layer.cornerRadius = self.imageView.width / 2;
    self.imageView.layer.borderColor = ColorWithHexString(@"43b9f0").CGColor;
    self.imageView.layer.borderWidth = 1;
    [self addSubview:self.imageView];
    
    self.titleLabel = [UILabel labelWithTitle:nil frame:CGRectMake(w(10), getMaxY(self.imageView),kScreenWidth/4 - w(20), h(42)) font:font(22) textColor:ColorWithHexString(@"4e778f") bgColor:ClearColor];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.titleLabel];
    
}

- (void)configCellWithModel:(IconModel *)model{
    
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:Image(@"daititupian3")];
    self.titleLabel.text = model.name;
    
}

@end
